package com.crscd.ai.config;

import com.crscd.ai.store.MongoChatMemoryStore;
import dev.langchain4j.memory.chat.ChatMemoryProvider;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Created with IntelliJ IDEA.
 *
 * @author： liuziyang
 * @date： 2025/9/23-22:10
 * @description：
 * @modifiedBy：
 * @version: 1.0
 */
@Configuration
public class SeparateChatAssistantConfig {
  @Bean
  public ChatMemoryProvider chatMemoryProvider(MongoChatMemoryStore store) {
    return memoryId ->
        MessageWindowChatMemory.builder()
            .id(memoryId)
            .chatMemoryStore(store)
            .maxMessages(10)
            .build();
  }
}
